Efficient Evaluation for Untyped and Compositional Representations of Expressions

نویسنده

  • Emil Axelsson
چکیده

This report gives a simple implementation of A. Baars and S.D. Swierstra’s “Typing Dynamic Typing” [5] using modern (GHC) Haskell features, and shows that the technique is especially beneficial in a compositional setting, where parts of the expression are defined separately. Evaluating expressions that are represented as algebraic data types typically requires using tagged unions to represent values. Tagged unions can introduce runtime overhead due to tag checking, and this overhead is unnecessary if the evaluated expression is well-typed. Likewise, pattern matching on the constructors of the expression causes overhead which is unnecessary if the same expression is evaluated multiple times. Typing Dynamic Typing solves both of these problems by deferring all tag checking to an initial “dynamic compilation” phase after which evaluation proceeds without any tag checking or pattern matching. The problems of tag checking and pattern matching are worse in a compositional setting, and our measurements show that the technique gives especially good performance gains for compositional expressions. Department of Computer Science and Engineering Chalmers University of Technology University of Gothenburg Göteborg, Sweden, 2014 Technical Report No. 2014:16 ISSN 1652-926X

برای دانلود رایگان متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

منابع مشابه

Evaluation of NAPSS Expression Involving Polyalgorithms, Functions, Recursion, and Untyped Variables

This paper describes how ari thmetic expressions are evaluated in NAPSS . A brief discussion is included covering the types of expressions permi t ted and where the dist inct ive operands arise. First , the flow through the ari thmetic expression evaluator is given for arithmetic expressions which do not involve recursion , function evaluation or polyalgorithm cal ls. The handl ing of each of t...

متن کامل

Approximating the Distributions of Singular Quadratic Expressions and their Ratios

Noncentral indefinite quadratic expressions in possibly non- singular normal vectors are represented in terms of the difference of two positive definite quadratic forms and an independently distributed linear combination of standard normal random variables. This result also ap- plies to quadratic forms in singular normal vectors for which no general representation is currently available. The ...

متن کامل

Higher Order Logic Programming with Untyped Lambda Expressions

A higher order logic programming system is presented. The declarative semantics of the system is based on the type-free higher order logic NaDSyL, which takes a nominalist approach to solving the set-theoretic paradoxes. The operational semantics is based on the deterministic and useful subset of higher order uni cation known as pattern uni cation. It is shown that the system allows all express...

متن کامل

Compositional Semantics using Feature-Based Models from WordNet

This article describes a method to build semantic representations of composite expressions in a compositional way by using WordNet relations to represent the meaning of words. The meaning of a target word is modelled as a vector in which its semantically related words are assigned weights according to both the type of the relationship and the distance to the target word. Word vectors are compos...

متن کامل

Reasoning about Contextual Equivalence: From Untyped to Polymorphically Typed Calculi

This paper describes a syntactical method for contextual equivalence in polymorphically typed lambda-calculi. Our specific calculus has letrec as cyclic let, data constructors, case-expressions, seq, and recursive types. The typed language is a subset of the untyped language. Normal-order reduction is defined for the untyped language. Since there are less typed contexts the typed contextual pre...

متن کامل

ذخیره در منابع من


  با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید

عنوان ژورنال:

دوره   شماره 

صفحات  -

تاریخ انتشار 2015